package com.scaffold.myproject.utils;


import com.scaffold.myproject.common.BizException;

/**
 * 业务断言工具
 */
public class BizAssertUtil {

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new BizException(message);
        }
    }

    public static void notEmpty(String str, String message) {
        if (str == null || str.trim().isEmpty()) {
            throw new BizException(message);
        }
    }

    /**
     * true 抛错
     */
    public static void check(Boolean expression, String message) {
        if (expression) {
            throw new BizException(message);
        }
    }


}
